
package atag.runtime.sensors;

import com.sun.spot.resources.Resources;
import com.sun.spot.resources.transducers.ITemperatureInput;
import com.sun.spot.sensorboard.peripheral.TemperatureInput;
import java.io.IOException;
/**
 *
 * @author Ajay Chhatwal
 */
public class TemperatureSensor implements ATaGSensor {
  
    private double currentReading;
    
    private ITemperatureInput temperatureSensor;
    
    /** Creates a new instance of TemperatureSensor */
    public TemperatureSensor() {
        temperatureSensor = 
        (ITemperatureInput) Resources.lookup( ITemperatureInput.class );
    }
 
    
    public double getCurrentReading() throws IOException {     
            this.currentReading = temperatureSensor.getCelsius();
            return this.currentReading;
    }
    
}
